﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CMS.Core {
	public class Article {
		private static Dao.Article _dao = new CMS.Dao.Article();

		public static int Count(int categoryId) {
			return _dao.Count(categoryId);
		}

		public static Model.Article GetModel(int articleId) {
			return _dao.Select(articleId);
		}

		/// <summary>
		/// 获取分页数据
		/// </summary>
		/// <param name="categoryId"></param>
		/// <param name="currPage"></param>
		/// <param name="pageSize"></param>
		/// <returns></returns>
		public static IList<Model.Article> GetPagerList(int categoryId, int pageIndex, int pageSize) {
			int skipResults = pageSize * (pageIndex - 1);
			return _dao.List(categoryId, skipResults, pageSize);
		}
	}
}
